package com.neusoft.EYSystem.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.neusoft.EYSystem.po.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserDAO extends BaseMapper<User> {


    @Select("SELECT * FROM user WHERE phone = #{username} OR username = #{username}")
    User getUser(User user);

    @Select("SELECT * FROM user WHERE role = 'caretaker'")
    List<User> getUserByRole();
}
